package com.example.beauty.controller;

import com.example.beauty.entity.User;
import com.example.beauty.resp.RespModel;
import com.example.beauty.service.UserService;
import com.example.beauty.vo.LoginData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author qin
 * @create 2022--09--13--16:00
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService;

    @PostMapping("/register")
    public RespModel register(User user) {
        System.out.println("注册参数：" + user);
        return userService.register(user);
    }

    @PostMapping("/login")
    public RespModel login(LoginData loginData) {
        System.out.println("接收登录参数：" + loginData);
        return userService.login(loginData);
    }
}
